%% get data from record
d = record1(1,1:1000);

%% get data with window
N = 400;
start_time = 7000;
L = length (d); % Window Length of FFT    
nfft = 2^nextpow2(L); % Transform length
d_win = d.*hanning(L)';            
Ydft_HannWnd = fft(d_win,nfft)/L;

plot(d,'b');hold on;plot(d_win,'r');
figure;getFrequency(d_w,1);hold on;getFrequency(d,1);
%% frequency
freq = [];
s = 400;
overlap = 200;
for i = 0:size(d,2)/overlap - s/overlap
idx = (i*overlap+1):(i*overlap + s);
d_des = d(1,idx);
% t_des = t(idx);

% d_filt = myFilter(d_des,[8,14]);
freq = [freq getFrequency(d_des)];
end
plot(freq)


